﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Util;
using System.IO;

public partial class FrontEnd_Dialog_UploadPhoto : System.Web.UI.Page
{
    public String message = "";
    protected BLO.User user;
    protected String userID;
    protected void Page_Load(object sender, EventArgs e)
    {
        Session.Add("LoginUser", "HienTT");
        if (Session["LoginUser"] == null) return;
        else userID = Session["LoginUser"].ToString();
        changeInfo();

    }
    protected void changeInfo()
    {
        String kind = Request.Form["hddKindSubmit"];
        if (kind == "change")
        {
            string blogName = Request.Form["txtBlogName"];
            string blogDescriptinon = Request.Form["txtDescriptionBlog"];
            user = new BLO.User();
            user.Info.ID = userID;
            user.Info.BlogDescription = blogDescriptinon;
            user.Info.BlogName =blogName;
            if (user.updateBlogInfo() != 0)
                Response.Redirect("~/FrontEnd/Default.aspx");
            else message = "Cập nhật thất bại";

        }
    }
}
